﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace CCF20Module
{
    /// <summary>
    /// Interaction logic for ErrorDetailWindow.xaml
    /// </summary>
    public partial class ErrorDetailWindow : Window
    {
        public ErrorDetailWindow()
        {
            InitializeComponent();
        }

        internal static ErrorDetailWindow BuildErrorDetailWindow(Window owner, Exception ex)
        {
            ErrorDetailWindow edw = new ErrorDetailWindow()
            {
                Owner = owner,
                Title = ex.GetType().FullName,
                WindowStartupLocation = WindowStartupLocation.CenterOwner
            };

            edw.errorDetailsTextBlock.Text = ex.ToString();

            return edw;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }
    }
}
